# -*- coding: utf-8 -*-
"""
 @Time    : 2021/2/5 下午5:23
 @Author  : tgy
 
"""

class Person:

    def __init__(self, name):
        self.name = name

    def __repr__(self):
        return 'repr name:{}'.format(self.name)

    def __str__(self):
        return 'str name:{name}'.format_map({'name':self.name})


def test01():
    ...
    person = Person('tony')
    print(person)
    # !r 强制使用 __repr__来显示类
    print('person: {!r}'.format(person))
    print('person: {0.name}'.format(person))


if __name__ == '__main__':
    ...
    test01()
